/**
 * Copyright &copy; 2012-2016 civet All rights reserved.
 */
package cn.mcsys.myadmin.modules.air.entity;

import cn.mcsys.myadmin.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 实习消息Entity
 * @author leopold
 * @version 2018-08-13
 */
public class AirRealtimeMessage extends DataEntity<AirRealtimeMessage> {
//	6条数
	public static final int LIMIT_SIX = 6;
//	3条数
	public static final int LIMIT_three = 3;
//	30条数
	public static final int LIMIT_THIRTY = 30;

//	调度请求
	public static final int CAR_INSUFFICIENT = 1;
//  异常反馈
	public static final int ABNORMAL_FEEDBACK = 2;
//  车辆调度操作
	public static final int SCHEDULING = 3;
//  信息报送
	public static final int DEPARTURE = 4;
//	车辆供应不足
	public static final int NOT_CAR = 5;
//	空闲车辆过多
	public static final int CAR_TOO_MANY = 6;
//	其他问题
	public static final int OTHER = 7;

	private static final long serialVersionUID = 1L;
	private AirRidePoint airRidePoint;		// air_ride_point
	private String airWorker;		// air_worker
	private Integer type;		// 消息类型
	private String title;		// 标题
	private Date feedbackDate;		// 反馈时间
	private String note;		// note


	public AirRealtimeMessage() {
		super();
	}

	public AirRealtimeMessage(Integer id){
		super(id);
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public AirRidePoint getAirRidePoint() {
		return airRidePoint;
	}

	public void setAirRidePoint(AirRidePoint airRidePoint) {
		this.airRidePoint = airRidePoint;
	}

	public String getAirWorker() {
		return airWorker;
	}

	public void setAirWorker(String airWorker) {
		this.airWorker = airWorker;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
	
	@Length(min=0, max=32, message="标题长度必须介于 0 和 32 之间")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public Date getFeedbackDate() {
		return feedbackDate;
	}

	public void setFeedbackDate(Date feedbackDate) {
		this.feedbackDate = feedbackDate;
	}
	
	@Length(min=0, max=64, message="note长度必须介于 0 和 64 之间")
	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public String typeString(){
		switch (type){
			case CAR_INSUFFICIENT:return "调度请求";
			case ABNORMAL_FEEDBACK:return "异常反馈";
			case SCHEDULING:return "车辆调度请求";
			case DEPARTURE:return "消息报送";
		}
		return "";
	}

	public static String chooseTitle(Integer type){
		String title = "";
		switch (type){
			case AirRealtimeMessage.NOT_CAR:title="车辆供应不足";break;
			case AirRealtimeMessage.CAR_TOO_MANY:title="空闲车辆过多";break;
			case AirRealtimeMessage.ABNORMAL_FEEDBACK:title="异常反馈";break;
			case AirRealtimeMessage.SCHEDULING:title="车辆调度操作";break;
			case AirRealtimeMessage.DEPARTURE:title="信息报送";break;
			case AirRealtimeMessage.OTHER:title="其他问题";break;
		}
		return title;
	}

}